sq_df = read_csv('squirrel_tidy.csv') %>%
janitor::clean_names()
\(H_0:\) Every parameter of predictors in our regression model is equal to zero.
\(H_1:\) Not every parameter of predictors in our regression model is equal to zero.
long_model_final = lm(long ~ shift + age + activity + reaction + sounds, data = sq_df)
anova(long_model_final) %>%
knitr::kable()
| Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
|---|---|---|---|---|---|
| shift | 1 | 0.0002502 | 0.0002502 | 4.245234 | 0.0394462 |
| age | 1 | 0.0004462 | 0.0004462 | 7.569035 | 0.0059734 |
| activity | 1 | 0.0003009 | 0.0003009 | 5.103838 | 0.0239441 |
| reaction | 1 | 0.0004229 | 0.0004229 | 7.175147 | 0.0074321 |
| sounds | 1 | 0.0011391 | 0.0011391 | 19.324337 | 0.0000114 |
| Residuals | 3017 | 0.1778414 | 0.0000589 | NA | NA |
We use anova test to make sure the predictors of our final Longitudinal regression fit are significant. Based on the results, the p-values of all five predictors (shift, age, activity, reaction and sounds) are smaller than 0.05 so we reject the null hypothesis and conclude that every predictor in our final longitudinal model is significant.
\(H_0:\) Every parameter of predictors in our regression model is equal to zero.
\(H_1:\) Not every parameter of predictors in our regression model is equal to zero.
lat_model_final = lm(lat ~ primary_fur_color + reaction + sounds, data = sq_df)
anova(lat_model_final) %>%
knitr::kable()
| Df | Sum Sq | Mean Sq | F value | Pr(>F) | |
|---|---|---|---|---|---|
| primary_fur_color | 1 | 0.0012564 | 0.0012564 | 12.03392 | 0.0005297 |
| reaction | 1 | 0.0011339 | 0.0011339 | 10.86081 | 0.0009936 |
| sounds | 1 | 0.0021015 | 0.0021015 | 20.12823 | 0.0000075 |
| Residuals | 3019 | 0.3151947 | 0.0001044 | NA | NA |
We use the same way (anova test) to make sure the predictors of our final Latitudinal regression fit are significant. Based on the results, the p-values of all three predictors (primary fur color, reaction and sounds) are smaller than 0.05 so we reject the null hypothesis and conclude that every predictor in our final latitudinal model is significant.